Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@babel/helper-define-polyfill-provider

Package Overview
Dependencies
Maintainers
6
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/helper-define-polyfill-provider

Babel helper to create your own polyfill provider

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
13M
decreased by-50.51%
Maintainers
6
Weekly downloads
 
Created

What is @babel/helper-define-polyfill-provider?

The @babel/helper-define-polyfill-provider package is part of the Babel ecosystem and is used to define a way to provide polyfills in your Babel configuration. It helps in specifying which polyfills to include based on the target environment and the features used in your code, ensuring that only necessary polyfills are added, thus optimizing the bundle size.

What are @babel/helper-define-polyfill-provider's main functionalities?

Define polyfill provider

This code sample demonstrates how to define a custom polyfill provider using the @babel/helper-define-polyfill-provider package. It specifies polyfills for 'Promise' and 'fetch' with their respective detection logic and paths to their polyfill modules.

import { createPolyfillProvider } from '@babel/helper-define-polyfill-provider';

const myPolyfillProvider = createPolyfillProvider({
  name: 'myPolyfillProvider',
  polyfills: {
    'Promise': {
      global: 'Promise',
      detection: 'Promise in global',
      path: 'core-js/modules/es.promise'
    },
    'fetch': {
      global: 'fetch',
      detection: 'fetch in global',
      path: 'whatwg-fetch'
    }
  }
});

Other packages similar to @babel/helper-define-polyfill-provider

Keywords

FAQs

Package last updated on 22 Dec 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc